Method and apparatus for automatically designing logic circuit, and multiplier

ABSTRACT

In the case where a multiplier factor is a constant, if the number of the bits having the value of 1 in the multiplier factor is 3 or more and if it is larger than the number of the bits having the value of 0, a circuit for performing multiplication by using the logic NOT number of the multiplier factor, which is obtained by inverting all the bits in the multiplier factor by the logic NOT operation is generated. If the number of the bits having the value of 1 in the multiplier factor is 3 or more and if it is smaller than the number of the bits having the value of 0, the multiplier factor is divided so that an adder for adding partial products forms a well-balanced binary tree. Conversely, if the number of the bits having the value of 1 in the multiplier factor is 2 or less, an add shift multiplier for calculating partial products only with respect to the bits having the value of 1 is generated.

This is a divisional of application Ser. No. 08/174,450, filed Dec. 28,1993 now U.S. Pat. No. 5,530,664.

BACKGROUND OF THE INVENTION

The present invention relates to a method and apparatus forautomatically designing a logic circuit, particularly a multiplier or alogic circuit including a multiplier, and to a multiplier.

Conventional multipliers for performing multiplication with digitalinformation are often used not only as single, independent LSIs but alsoas elements to be mounted in such LSIs as DSP (digital signalprocessor). However, as the bit width is increased in multiplication andtheir applications are more diversified, multipliers of this type arerequired to have reduced circuit size and chip area as well as tooperate at higher speed. To meet the requirements, circuit systems usingvarious multiplication methods have been proposed.

For example, a multiplication method using the Booth's 2-bit recodesystem, which is one of the highest-speed multiplication methods, isdisclosed in "Nikkei Electronics" (May 29, pp.76-89(1978)). Themultiplication method uses the following algorithm in order to increasethe speed of multiplication.

If an n-bit multiplicand X is to be multiplied by an m-bit multiplierfactor Y, e.g., the multiplier factor Y is represented by two'scomplements as follows: ##EQU1## where ym=ys, q=m/2 if m is an evennumber or q=(m-1)/2 if m is an odd number, and y0=0 (y is a value givenfor convenience).

Hence, the product P of X and Y becomes ##EQU2##

Here, since the values of y_(2i), y_(2i+1), and y_(2i+2) are 0 or 1,(y_(2i) +y_(2i+1) -2y_(2i+2)) becomes 0, ±1, or ±2, so that each oftheir partial products becomes a value obtained by multiplying 0, ±X, or±2X by 2^(2i).

                  TABLE 1                                                         ______________________________________                                        y.sub.2i+2                                                                           y.sub.2i+    y.sub.2i                                                                            (y.sub.2i + y.sub.2i+1 - 2y.sub.2i+2)               ______________________________________                                        0      0            0     0                                                   0      0            1     +1                                                  0      1            0     +1                                                  0      1            1     +2                                                  1      0            0     -2                                                  1      0            1     -1                                                  1      1            0     -1                                                  1      1            1     0                                                   ______________________________________                                    

Here, a circuit for generating the partial products can be composed of ashifter primarily for shifting the multiplicand ±X by one bit till it isdoubled and a shifter for shifting a mantissa (0, ±X or ±2X) by two bitstill it is raised to the power of 2^(2i) (weighing).

As for the number of logic stages in a circuit for calculating the totalsum of the partial products, since the number of the partial productsbecomes q=m/2 (m is an even number) or q=(m-1)/2 (m is an odd number),it becomes approximately log₂ m-1 (m is an even number) or log₂ (m-1)-1(m is an odd number) when a 2-input adder is connected so as to form abinary tree.

As an example of high-speed multipliers not using the Booth's 2-bitrecode system, Japanese Patent Publication no. 03-017737 discloses amultiplier using redundant binary code.

With the multiplier mentioned above, when the multiplier factor iscomposed of 24 bits, the number of its partial products becomes 12 andthe number of its logic stages becomes 4.

On the other hand, the increase in multiplication speed and the decreasein circuit size have been pursued not only by improving the performanceof such a multiplication algorithm as mentioned above, but also byoptimizing the circuit on the level of logic elements.

In recent years, multipliers and logic circuits containing multipliersare mostly designed by using automatic designing systems. Such a systemis intended to eliminate a redundant portion of the circuit or toperform other operations by replacing a part of the circuit with anequivalent circuit having a smaller number of logic elements and logicstages in the case of, e.g., expanding circuit information on the levelof logic elements to circuit information on the level of mountedelements, which are actually mounted in a chip.

If functional description information, which represents a functionrequested on the circuit in a hardware description language or the like,is inputted to such an automatic designing system, the system convertsit to functional circuit information in an internal representation form,which represents a circuit composed of virtual functional elements whosefunctions are primarily and solely defined. Then, the resultingfunctional circuit information is further converted to logic circuitinformation which represents a circuit composed of real logic circuits,followed by the generation of mounted circuit information whichrepresents a circuit to which real elements, mounted by specifiedtechnology, are allotted.

With the conventional automatic designing systems, however, theoptimization of the circuit on the level of logic elements is localized,for the replacement by an equivalent circuit having a smaller number oflogic elements and logic stages is limited to portions of the circuitthat coincide with specific patterns which were preliminarily set. Ifsuch optimization is performed in the case where the multiplier factoror multiplicand is a constant, a circuit having the minimum number oflogic elements and the like cannot necessarily be obtained. Inparticular, when a two-input adder for adding partial products isconnected so as to form a binary tree, the balance between two branchesis normally destroyed if the portion associated with the add circuit forthe partial products, in which the values of all the bits are 0, isomitted. Therefore, it is difficult to minimize the number of logicelements and the number of logic stages by partially replacing thecircuit.

SUMMARY OF THE INVENTION

In view of the foregoing, an object of the present invention, in thecase of generating a multiplier for performing multiplication by using aconstant as its multiplier factor or multiplicand or a logic circuitincluding such a multiplier, is to provide a method and apparatus forautomatically designing a logic circuit having a smaller number of logicelements and logic stages and to provide a high-speed multiplier forperforming multiplication by using a constant as is multiplier factor ormultiplicand, which has a smaller number of logic elements and logicstages appropriately for large-scale integration.

To attain the above object, a method of automatically designing a logiccircuit for generating information on the logic circuit for calculatingthe product of a multiplier factor, which is a constant, and amultiplicand, comprises the steps of: (a) inputting the value of saidmultiplier factor: (b) detecting a bit having the value of 1 in saidmultiplier factor; (c) generating information on a partial productcalculating circuit for calculating the partial products of saidmultiplier factor and multiplicand only with respect to the bits havingthe value of 1 in said multiplier factor, depending on the result ofdetection obtained in said step (b); and (d) generating information on apartial product sum calculating circuit for calculating the sum of thepartial products calculated by said partial product calculating circuit.

To attain the above object, an apparatus for automatically designing alogic circuit for generating information on the logic circuit forcalculating the product of a multiplier factor, which is a constant, anda multiplicand, comprises: an input means for inputting the value ofsaid multiplier factor; a detecting means for detecting the bits havingthe value of 1 in said multiplier factor; a first circuit informationgenerating means for generating information on a partial productcalculating circuit for calculating the partial products of saidmultiplier factor and multiplicand only with respect to the bits havingthe value of 1 in said multiplier factor, depending on the result ofdetection by said detecting means; and a second circuit informationgenerating means for generating information on a partial product sumcalculating means for calculating the sum of the partial productscalculated by said partial product calculating circuit.

With the above structure, information on a partial product calculatingcircuit, which calculates the partial products of the bits having thevalue of 1 in the multiplier factor and the multiplicand, and on apartial product sum calculating circuit, which calculates the sum of thepartial products, is generated. Consequently, it becomes possible toeasily reduce circuit size and increase multiplication speed.

Preferably, the above method of automatically generating a logic circuitfurther comprises the step of (e) dividing the bits having the value of1 into groups so that each group contains about the same number of bitshaving the value of 1 if the number of the bits having the value of 1 is4 or more, wherein information on the partial product sum calculatingcircuit for adding the partial products which correspond to theindividual groups is generated in said step (d).

The above apparatus for automatically calculating a logic circuitfurther comprises: a bit number detecting means for detecting the numberof the bits having the value of 1 in said multiplier factor; and agrouping means for dividing the bits having the value of 1 into groupsso that each group contains about the same number of bits having thevalue of 1 if the number of said bits detected by said bit numberdetecting means is 4 or more, wherein said second circuit informationgenerating means generates information on the partial product sumcalculating circuit for adding the partial products which correspond tothe individual groups.

Thus, even when the bits having the value of 1 are unevenly distributed,the multiplier factor is divided into groups so that each group hassubstantially the same number of the bits having the value of 1, therebygenerating information on the partial product sum calculating circuitfor calculating the sum of partial products. Consequently, the partialproduct sum calculating circuit is structured in a well-balanced binarytree, which readily realizes higher-speed multiplication and reduces thenumber of logic stages in the circuit.

The above step (e), or grouping by the grouping means, may be performedin the case where the number of the bits having the value of 1 is 2 or3.

Preferably, the above method of automatically designing a logic circuitfurther comprises the step of (f) generating information on a logic NOTgenerating circuit for providing the logic NOT number of said multiplierfactor, which is obtained by inverting all the bits in said multiplierfactor, if the number of the bits having the value of 1 in saidmultiplier factor is about 1/2 or more of the number of all the bits insaid multiplier factor, the process being performed in said steps (b) to(d) by using said logic NOT number as the multiplier factor, said methodof automatically designing a logic circuit further comprising the stepsof

(g) generating information on a product correcting circuit forcalculating the product of the original multiplier factor and saidmultiplicand, based on the product of said logic NOT number and saidmultiplicand.

The above apparatus for automatically designing a logic circuit furthercomprises: a third circuit information generating means for generatinginformation on a logic NOT generating circuit for providing the logicNOT number of said multiplier factor, which is obtained by inverting allthe bits in said multiplier factor by the logic NOT operation, if thenumber of the bits having the value of 1 in said multiplier factor isabout 1/2 or more of the number of all the bits in said multiplierfactor, said detecting means, first circuit information generatingmeans, and second circuit information generating means performing theprocess by using said logic NOT number as the multiplier factor, saidapparatus for automatically designing a logic circuit further comprisinga fourth circuit information generating means for generating informationon a product correcting circuit for calculating the product of theoriginal multiplier factor and said multiplicand, based on the productof said logic NOT number and said multiplicand.

Thus, if the number of the bits having the value of 1 in the multiplierfactor is about 1/2 or more of the number of all the bits in themultiplier factor, information on a logic NOT circuit for generating thelogic NOT number of the multiplier factor is generated, and informationon a circuit which performs multiplication by using the resulting logicNOT number as the multiplier factor, i.e., by using the multiplierfactor in which a smaller number of bits have the value of 1 isgenerated. Consequently, it becomes possible to easily constitute ahigher-speed multiplier or a multiplier composed of a smaller-sizecircuit.

To attain the above object, a multiplier which receives a signal Xrepresenting an n-bit number and a signal A representing an m-bitconstant as its inputs and outputs their product P having the bit widthof (n+m), comprises: a multiplying means which receives the logic NOTsignal A0 of said constant A and said signal X as its inputs and outputsa signal P0 representing their product; and a correcting means whichreceives said signal X and signal P0 as its inputs, calculates X*(2^(m)-1)-P0, and outputs the result of calculation as said P.

With the above structure, the multiplying means multiplies themultiplicand X by the multiplier factor A0 which is obtained byinverting all the bits in the multiplier A by the logic NOT operation.Hence, even when the number of the bits having the value of 1 is about1/2 or more of the number of all the bits in the multiplier A, thenumber of partial products can be reduced to m/2 or less, resulting inthe reduction in circuit area and the increase in multiplication speed.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing the hardware structure of an automaticlogic-circuit designing system according to the first embodiment of thepresent invention;

FIG. 2 is a view showing the structure of a storage device of theforegoing automatic designing system;

FIGS. 3(a) to 3(c) are views showing a circuit to be stored in a circuitdata storage unit of the foregoing storage device, functionaldescription information on the circuit, and functional circuitinformation on the circuit, respectively;

FIGS. 4(a) to 4(c) are views showing a circuit including a multiplier asa functional element, functional description information on the circuit,and functional circuit information on the circuit, respectively;

FIG. 5 is a flow chart of the main routine showing the designing processof the foregoing automatic designing system;

FIG. 6 is a flow chart showing the process of conversion of functionalelement of Step 43 in detail;

FIGS. 7(a) to 7(d) are views showing a multiplier as a functionalelement;

FIG. 8 is a flow chart showing the process of generating multiplier ofStep 85 of FIG. 6 in detail;

FIGS. 9(a) to 9(d) are circuit diagrams showing circuits generated inSteps 1002, 1006, 1008, and 1010 of FIG. 8, respectively;

FIGS. 10(a) to 10(c) are views showing conversion rule 1;

FIG. 11 is a flow chart showing the process of conversion of functionalelement of Step 1012 of FIG. 8 in detail;

FIG. 12 is a flow chart showing the process of generating multiplier bitmultiplier of Step 1013 of FIG. 8 in detail;

FIG. 13 is a view showing conversion rule 2;

FIG. 14 is a block diagram showing the structure for performing theprocess of Step 142 of FIG. 12 in terms of its function;

FIG. 15 is a flow chart showing the process of generating add shiftmultiplier of Step 144 of FIG. 12 in detail;

FIGS. 16(a) and 16(b) are views showing conversion rule 3 with FIG.16(a) illustrating conversion rule 3(a) when the most significant bit is1, and FIG. 16(b) illustrating conversion rule 3(b) when the mostsignificant bit is 0;

FIG. 17 is a view illustrating the internal representation of theconversion rule 3;

FIG. 18 is a block diagram showing the structure for performing theprocess of Step 144 of FIG. 12 in terms of its function;

FIG. 19 is a view showing conversion rule 4;

FIG. 20 is a block diagram showing the structure for performing theprocess of Step 147 of FIG. 12 in terms of its function;

FIG. 21 is a block diagram showing a variation of the structure forperforming the same process sequence as that of Steps 141 through 147shown in FIG. 12 according to the first embodiment of the presentinvention;

FIG. 22 is a flow chart showing another example, in the third embodimentof the present invention, of the process of generating multiple bitmultiplier performed in Step 1013 of the first embodiment which is shownin FIG. 8;

FIG. 23 is a view showing conversion rule 5;

FIG. 24 is a flow chart showing another example, in the fourthembodiment of the present invention, of the process of generating addshift multiplier performed in Step 144 of the first embodiment which isshown in FIG. 12;

FIGS. 25(a) and 25(b) are views showing conversion rule with FIG. 25(a)and illustrating conversion rule 6(a) when A(K-1)=1, and FIG. 25(b)illustrating conversion rule 6(b) when A(K-1)=0;

FIG. 26 is a view showing conversion rule 7 in the fifth embodiment ofthe present invention;

FIG. 27 is a block diagram showing the structure for performing theprocess according to the conversion rule 7 in terms of its function; and

FIGS. 28(a) to 28(c) are views showing other examples of the conversionrule 4 in the sixth embodiment of the present invention and multiplierswhich are generated according to these conversion rules.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Below, embodiments of the present invention will be described withreference to the drawings.

EXAMPLE 1

FIG. 1 is a block diagram showing an example of the hardware structureof an automatic logic-circuit designing system.

In FIG. 1, an input device 11 is for inputting functional descriptioninformation on a circuit to be designed by the automatic designingsystem. The input device 11 can be composed of a keyboard, mouse, lightpen, card reader, or schematic entry system. Aside from the foregoingdevices that accept the inputting of information through a directoperation by an operator, it can also be composed of a magnetic diskdevice, which stores information preliminarily inputted through theforegoing devices as a file, or of an network device which receivesinformation sent from another device.

A CPU 12 is for performing circuit-designing processes such as logicalsynthesis or circuit optimization by executing a variety of processes,which will be described below.

An output device 13 is for outputting circuit information which is theresult of the designing process by the CPU 12 or a variety ofinformation on processing. The output device 13 can be composed of agraphic display, character display, printer, or plotter. The outputdevice 13 can also be composed of the magnetic disk device or networkdevice, similarly to the input device 11.

A storage device 14 consists of, for example, a design process storageunit 21, element library storage unit 22, and circuit data storage unit23, as shown in FIG. 2, so that it can store information inputtedthrough the input device 11 and programs or data on circuit-designingprocesses.

Specifically, the design process storage unit 21 stores a variety ofprograms whereby the foregoing CPU 12 executes design processes andconversion rule information to be applied in the course of theseprocesses.

The element library storage unit 22 stores information on the functionsof functional elements, logic elements, and mounted elements and ontheir area, delay time, and driving forces, so as to provide an elementlibrary.

The circuit data storage unit 23 stores functional descriptioninformation which is inputted through the input device 11 and functionalcircuit information, logic circuit information, and mounted circuitinformation, each of which is generated by the circuit-designingprocesses.

The foregoing functional description information is mainly on a functionrequired on a circuit, and is represented in a hardware descriptionlanguage. The functional circuit information is mainly on a circuit thatis composed of virtual functional elements, the functions of which areonly defined, and is represented in an internal representation form. Thelogic circuit information shows a circuit composed of real logicelements, which are on a logic level seldom dependent on the fabricationprocess or design methods. On the other hand, the mounted circuitinformation is greatly dependent on the fabrication process and designmethods and shows a circuit to which are allotted elements actuallymounted by a specified technology (e.g., a standard cell composed of aCMOS transistor, a cell in the library of a gate array, or TTL, ECL, andthe like which are dependent on the fabrication process).

Examples of the foregoing functional elements are shown in Table 2. Forexample, a multiple-bit adder represents a functional element for addingtwo multiple-bit numbers. A comparator represents a functional elementfor comparing two multiple-bit numbers. A multiple-bit AND represents afunctional element for calculating bit-by-bit logic products of twomultiple-bit signals. A multiple-bit INV represents a logical elementfor calculating bit-by-bit logic NOTs in a multiple-bit signal.

A ripper is a functional element for conveniently dividing amultiple-bit signal during the course of conversion process. On theother hand, a mixer is a functional element for conveniently processingthe multiple-bit signal as a whole. The ripper and mixer are functionalelements which are eventually converted to a circuit composed of mountedelements and eliminated when all signals are processed in 1-bit signals.

In general, there exists no circuit that is composed of mounted elementsdirectly corresponding to these functional elements. The functionalelements are expanded to a circuit composed of real logic elements whichrealize their functions, and then replaced by a circuit composed ofmounted elements.

                  TABLE 2                                                         ______________________________________                                                MULTIPLE-BIT ADDER                                                            MULTIPLE-BIT SUBTRACTER                                                       MULTIPLE-BIT MULTIPLIER                                                       MULTIPLE-BIT DIVIDER                                                          COMPARATOR                                                                    ENCODER                                                                       DECODER                                                                       SELECTOR                                                                      MULTIPLEXER                                                                   COUNTER                                                                       LATCH                                                                         FLIP-FLOP                                                                     BUFFER                                                                        REGISTER                                                                      SHIFTER                                                                       MIXER                                                                         RIPPER                                                                        MULTIPLE-BIT AND                                                              MULTIPLE-BIT NAND                                                             MULTIPLE-BIT OR                                                               MULTIPLE-BIT NOR                                                              MULTIPLE-BIT XOR                                                              MULTIPLE-BIT INV                                                      ______________________________________                                    

Examples of the logic elements are shown in Table 3, in which,BIT-BY-BIT ADDER represents an element for adding two 1-bit signals and1-BIT AND represents a logic element for calculating the logic productof two or more 1-bit signals.

The circuit composed of mounted elements corresponding to these logicelements are preliminarily determined so that the logic elements areeventually replaced by the circuit on the final stage of designprocessing.

                  TABLE 3                                                         ______________________________________                                                  BIT-BY-BIT ADDER                                                    ______________________________________                                                  1-BIT AND                                                                     1-BIT NAND                                                                    1-BIT OR                                                                      1-BIT NOR                                                                     1-BIT XOR                                                                     1-BIT INV                                                           ______________________________________                                    

Next, specific examples of the functional description information and ofthe functional circuit information to be stored in the circuit datastorage unit 23 will be described. These sets of information are storedas, e.g., text information.

A circuit composed of, e.g., 1-bit 2-input AND gate and a 1-bit 3-inputadder shown in FIG. 3(a) is described in the functional descriptioninformation shown in FIG. 3(b). The functional description informationis converted to the functional circuit information or logic circuitinformation shown in FIG. 3(c). The functional circuits information andlogic circuit information may not particularly be distinguished fromeach other in the case shown above where the functional descriptioninformation corresponds directly to the circuit composed of thefunctional elements.

In this example, the functional circuit information includes anidentification name for identifying an individual element and aplurality of pairs of attribute code 32 and attribute value 33. Theattribute code 32 and attribute value 33 in each pair are mapped with "::". The individual pairs are separated by ";", and the identificationnames 31 are separated from other information by ": : :". The attributecodes 32 include "a₋₋ kind₋₋ of", "input", "output", and the like, eachshowing that its corresponding attribute value 33 refers to the type ofelement, its input signal, and its output signal.

That is, the element of the gate 01 is an adder, its input signals aresig1, sig2, and sig3, and its output signals are sig4 and sig5. On theother hand, the element of the gate 02 is an AND, its input signals aresig6 and sig7, and its output signal is sig3. It is also shown that thegate01 and gate02 are connected by the signal sig3.

Similarly, a circuit composed of a multiplier 51 serving as a functionalelement, a signal line 52 to which an 8-bit constant having the value of130 (82h in the hexadecimal notation) is inputted as a multiplierfactor, a signal line 53 to which an 8-bit multiplicand a is inputted,and a signal line 54 which outputs a 16-bit multiplication result b, asshown in FIG. 4(a), is described in the functional descriptioninformation shown in FIG. 4(b), and is converted to the functionalcircuit information as shown in FIG. 4(c). Here, the distinction betweenthe multiplier factor and the multiplicand is provided for theconvenience of conversion processes.

In the functional description information of FIG. 4(b), the multiplicanda is a signal having the bit width of 8 ranging from 0 bit to 7 bit. Thevariable b is a signal having the width of 16 ranging from 0 bit to 15bit. It is shown that the value of the variable b is the product of themultiplicand a and the multiplier factor 130 which is represented by an8-bit signal having the value of 130.

In the functional circuit information of FIG. 4(c), the first line showsthat the functional element has the identification name of gate1 and itserves as a multiplier. The descriptions in the second and fourth linesshow that the signal a represented by a sign i1 is an 8-bit input signalhaving the value of 130. The descriptions in the third and fifth linesshow that the signal represented by a sign i2 is an 8-bit input signalwhich is a constant. The description in the sixth line shows that thesignal represented by a sign ∘ is a 16-bit output signal b.

For simplicity, the content of information will be shown in thefollowing description by such schematic diagrams as shown in FIG. 3(a)and in FIG. 4(a), irrespective of the types of information such as thefunctional description information, functional circuit information, andlogic circuit information. If necessary, such terms as multiplier factorand multiplicand will also be used as their values or signals whichrepresent the multiplier factor and multiplicand, and the term circuitwill also be used as information which represents a circuit, providedthat they are not causing a confusion.

The following description will also use the notation shown below.

A number having the bit width of (a-b+1) ranging from the a-th bit tothe b-th bit (a>b) from the least significant digit is designated byX(a:b), while the a-th bit in the number X is designated by X(a).

Moreover, a function will be defined as follows.

For a k-bit signal Y, the number of bits having the value of 1 isdefined as posibits (Y), while the number of bits having the value of 0is defined as negabits (Y).

The number of bits, which is obtained by calculating the number of thebits having the value of 1 from the least significant value till itbecomes P(P<k), is defined as effbitwidth (Y, P). Since the processesfor obtaining the values of these functions can easily be realized, thedetailed description thereof will be omitted.

Next, the design processes to be implemented by the automatic designingsystem will be described below.

FIG. 5 is a flow chart showing the main routine of the designingprocess.

In Step 41 is performed a process of inputting the functionaldescription information formed on the basis of the functionalspecification by a functional designer of the circuit through the inputdevice 11 and storing it in the circuit data storage unit 23. It is alsopossible to design the input device 11 so that it accepts the inputtingof not only the functional description information but also thefunctional circuit information and logic circuit information oncomparatively simple portions of the circuit.

In Step 42 is performed a process of interpreting the functionaldescription information which was inputted in Step 41, generatingfunctional circuit information in which a circuit consisting of thefunctional elements and having the function shown in the functionaldescription information is represented in the internal representationform, and storing it in the circuit data storage unit 23.

In Step 43 is performed a process of converting all the functionalelements contained in the functional circuit information to logicelements and storing the resulting logic circuit information in thecircuit data storage unit 28. As for the circuit including a multiplier,the circuit optimization on the level of functional elements is alsoperformed. The process of Step 43 will be described later in detail.

In Step 44 is performed a process of allotting all the logic elementscontained in the logic circuit information to mounted elements throughthe element conversion process based on specified conversion ruleinformation. In this step is also performed circuit optimization on thelevel of logic elements during the course of allotting the logicelements to the mounted element.

In step 45 is performed a process of generating a circuit diagram andnet list based on mounted circuit information and the like andoutputting them to the output device 13. The net list mentioned aboverefers to information on, e.g., the connections between the mountedelements in the circuit constituted by the mounted elements.

The processes performed in above Steps 42 and 44 are the same as thosedisclosed in Japanese Laid-open Patent Publication no. 3-15984 and inU.S. Pat. No. 5,043,914, so that the detailed description thereof isomitted here.

In above Step 43, the process shown in detail in FIG. 6 is performed.

In Step 81, one of the functional elements included in the functionalcircuit information is selected.

In Steps 82 and 83, it is determined whether or not the selectedfunctional element is an adder or a multiplier. If it is an adder, theprocess goes on to Step 84. If it is a multiplier, the process goes onto Step 85. If it is neither an adder nor a multiplier, the process goeson to Step 86.

In each of Steps 84 to 86, the selected functional element is convertedto a circuit having the same function which is constituted by at leasteither of other functional elements and logic elements. After itscircuit information is generated, the process goes on to Step 87.

In Step 87, it is determined whether or not the circuit includes afunctional element. If it does, the process goes back to Step 81 so asto repeat the similar processing. If it does not, which means that thecircuit obtained by conversion is constituted only by logic circuits,the process returns to the main routine.

In above Steps 84 to 88, a single conversion process does notnecessarily provide a circuit that is constituted only by logicelements. Instead, the circuit resulting from the conversion maytemporarily include other functional elements. In this case, it isdetermined in Step 87 that a functional element is included and, byrecursively performing similar conversion processes, a circuitconstituted only by logic circuits is eventually obtained. Specifically,a multiple-bit adder is repeatedly converted to an adder having asmaller number of bits (functional element) and to a 1-bit adder(logical element) in Step 84, resulting in a circuit constituted only by1-bit adders. On the other hand, a subtracter and a divider areconverted to a circuit composed of functional elements such as addersand of logic circuits in Step 86, and then the functional elements suchas adders are converted to 1-bit adders in Step 84. Thus, by recursivelyperforming the conversion processes, the individual processes willeasily be simplified.

The multiplier which is determined as such with "yes" in Step 83 andwhich is subjected to conversion in Step 85 is provided with thefunction shown in FIGS. 7(a) to 7(d). The multipliers are the same inthat each of them has the function of multiplying a multiplicandrepresented by an n-bit signal by a multiplier factor represented by anm-bit signal so as to output a product P represented by a signal havingthe bit width of (n+m). However, they are different in that themultiplier factor and multiplicand which are inputted thereto are aconstant A, constant B, variable X, or variable Y. For simplicity, theconstant A will be treated as a positive number in the followingdescription. In the case where the constant A is an negative number, thesign of the constant A is inverted so as to generate information on themultiply circuit with respect to the resulting constant A' with theinverted sign and on the circuit for inverting the sign of themultiplication result, thereby providing the proper procedure. In thefollowing description, the variable X may have a positive or negativevalue.

Below, the conversion process performed in above Step 85 will bedescribed in detail by using a multiplier shown in FIG. 7 in accordancewith the flow chart of FIG. 8. The process is for converting themultiplier to a circuit constituted by other functional elements such asmultipliers and adders or by logic elements.

In Step 1001, it is determined whether or not each of the multiplierfactor and multiplicand is a constant or not. If the answer is yes, asshown in FIG. 7(a), the process goes on to Step 1002 where their productis calculated and conversion is made to a circuit which generates asignal representing its value in binary code. Specifically, if themultiplicand X=4 and the multiplier factor A=5, conversion is made to acircuit which outputs a signal representing the value of 4×5=20 (`10100`in binary code) as P(4:0) and a signal representing the value of 0 asP(n+m-1:5), as shown in FIG. 9(a).

If it is determined in Step 1001 that at least either of the multiplierfactor or multiplicand is a variable, the process goes on to Step 1003where it is determined whether or not the multiplicand is a constant,and if the multiplicand is a constant, the multiplier factor andmultiplicand are interchanged in Step 1004 so that the process goes onto Step 1005. If the multiplicand is not a constant, on the other hand,the process directly goes on to Step 1005. That is, in the case of usingthe multiplier shown in FIG. 7(b), it is converted to the multipliershown in FIG. 7(c) so that at least the multiplicand is constantly avariable.

In Steps 1005, 1007, and 1009, it is determined whether or not themultiplier factor is a special constant, i.e., its value is 0, 1, or anumber obtained by raising 2 to a certain power. If the multiplierfactor is 0, conversion is made to a circuit for outputting a signalwhich shows that the values of all the bits are 0, as shown in FIG. 9(b)(Step 1006). If the multiplier factor is 1, conversion is made to acircuit which outputs a signal representing the value of themultiplicand as P(n-1:0), while outputting a signal having the value ofX(n-1) as P(n+m-1:n) by sign extension (Step 1008). If the multiplierfactor is a number obtained by raising 2 to a certain power, e.g., if itis 8 (=2³), conversion is made to a circuit which outputs a signalrepresenting the value of the multiplicand as P (n+2:3), outputs asignal having the value of 0 as P(2:0), and outputs a signal in whichthe value of each bit is X(n-1) as P(n+m-1:n+3) by sign extension, asshown in FIG. 9(d) (Step 1010).

In Step 1011, it is determined whether the multiplier factor is composedof 1 bit or 2 or more bits. If it is composed of 1 bit, as shown in FIG.10(a), the process goes on to Step 1012, where conversion is made to acircuit composed of AND circuits 132 to 135 as shown in FIG. 10(b). Thedetermination of 1 bit in Step 1011 is limited to the case where themultiplier factor is a variable, because, if the multiplier factor is a1-bit constant, the answers obtained in above Steps 1005 and 1007 musthave been `yes`. The determination of 2 or more bits includes the caseswhere the multiplier factor is a variable and where the multiplierfactor is a constant.

In above Steps 1006, 1008, 1010, and 1012, conversion to a circuit isperformed based on the conversion rule information which ispreliminarily stored in the design process storage unit 21. For example,the conversion of step 1012 is performed based on conversion rule 1shown in FIG. 10(c) by following the process shown in FIG. 11.

First, in Step 71, a condition clause precedent to "==>" in theconversion rule information is compared with the initial circuitinformation. If it satisfies a conversion application condition, thenames of signal lines and the like are mapped.

In Step 72, the circuit information on the initial multiplier as afunctional element is deleted from the circuit data storage unit 23.

In Step 73, information on a circuit to be obtained after conversion isgenerated on the basis of the circuit information on functional elementsor logic elements shown in a condition clause subsequent to "==>" in theconversion rule information and of the foregoing mapping. The resultinginformation is then entered in the circuit data storage unit 23.

In Step 74, it is determined whether or not unprocessed functional orlogic elements remain in the condition clause. If the answer is yes, theprocess goes back to above Step 73. If the answer is no, on thecontrary, the process returns to the initial process.

The proof of conversion to a circuit which is equivalent to the initialmultiplier according to the foregoing conversion rule 1 will be achievedlater along with the proof of other conversion rules. However, since aspecific process of converting elements is disclosed in U.S. Pat. No.5,043,914, the detailed description thereof will be omitted. Althoughthe conversion rule information is actually represented in the internalrepresentation form as shown in FIG. 10(c), it will principally beillustrated in the following description by such schematic diagrams asshown in FIGS. 10(a) and 10(b) for simplification.

If it is determined that the multiplier factor is composed of 2 or morebits in above Step 1011, the process goes on to Step 1013, whereconversion is made to a multiple-bit multiplier composed of at leasteither of other functional elements (multiplier or adder having areduced bit width) and logic elements.

FIG. 12 is a flow chart showing the process performed in above Step 1013in detail. In the process, the number of partial products and the numberof logic stages for calculating the sum of the partial products aremostly reduced in the following manner.

In the case where the multiplier factor is a constant, conversion ismade to a circuit which calculates a partial product only with respectto a bit having the value of 1 in the multiplier factor or in a logicNOT number which is obtained by inverting all the bits in the multiplierfactor by the logic NOT operation, thereby reducing the number of thepartial products. In each of the cases where the multiplier factor is aconstant and where the multiplier factor is a variable, conversion ismade to a circuit in which an adder is connected so as to form a binarytree, thereby reducing the number of logic stages in the circuit forcalculating the sum of the partial products.

First, in Step 141, it is determined whether or not the multiplier is avariable or not. If the answer is yes, it follows that multiplicationwill be performed by using variables as its multiplier factor andmultiplicand, so that the process goes on to Step 142. In Step 142,conversion is made, according to conversion rule 2, to a circuitincluding two multipliers in which the multiplier factor having the bitwidth of about 1/2 is used.

According to the foregoing conversion rule 2, a multiplier 191, whichoutputs a product P by multiplying an n-bit multiplicand X by an m-bitmultiplier factor Y, is converted to a circuit consisting of multipliers192 and 193, which calculates partial products P1 and P2 by multiplyingthe multiplicand X by the low-order K bits and high-order (m-K) bits ofthe multiplier factor Y, respectively, and of a circuit for adding theresulting partial products P1 and P2. However, since it is sufficientfor the foregoing circuit to perform addition only with respect to theoverlapping bit of the partial products P1 and P2 and to the bits higherthan the overlapping bit, it is constituted by a ripper 194 forseparating the high-order n bits of the partial product P1 from itslow-order K bits, mixer 195 for outputting a signal R1 obtained byextending the sign of the high-order n bits, and an adder 196 for addingthe signal R1 and the partial product P2.

More specifically, the foregoing multiplier 192 is a circuit formultiplying the multiplicand X (n-1:0) by the low-order K bitsY1=Y(K-1:0) of the multiplier factor Y and outputting a signal P1(n+K-1:0) having the bit width of (n+K) as a partial product.

On the other hand, the multiplier 193 is a circuit for multiplying themultiplicand X (n-1:0) by the high-order (m-K) bits Y2=Y(m-1:K) of themultiplier factor Y and outputting a signal P2 (n+m-K-1:0) having thebit width of (n+m-K) as a partial product.

The ripper 194 is a circuit for dividing the foregoing signal P1(n+K-1:0) into a signal P1 (n+K-1:K) composed of the high-order n bitsand a signal P1 (K-1:0) composed of the low-order K bits. The lattersignal P1 (K-1:0) is outputted as a signal P (K-1:0) representing thelow-order K bits of the product P.

The mixer 195 is a circuit for gathering a signal having the bit widthof (m-K), in which the value of each bit is P1 (n+K-1), in the highorder of the signal P1 (n+-1:K) and for outputting a signal R1(n+m-K-1:0) having the bit width of (n+m-K) by extending the sign of thesignal P1.

The adder 196 is a circuit for adding the foregoing signal P2(n+m-K-1:0) and the signal R1 (n+m-K-1:0) and for outputting a signal R2(n+m-K1:0) having the bit width of (n+m-K), which is the sum of theforegoing signals, as a signal P (n+m-1:K) representing the high-order(n+m-K) bits of the product P.

If the respective bit widths K and (m-K) of the multiplier factors to beinputted to the multipliers 192 and 193 included in the circuit obtainedby conversion are 2 or more (i.e., the multipliers obtained byconversion are also functional elements), conversion is made to acircuit including multipliers having a further reduced bit width, whileStep 142 is executed in the process of the next loop. Conversely, ifeither of the respective bit widths K and (m-K) of the multiplierfactors becomes 1, conversion is made to a circuit consisting of ANDcircuits (logic elements) in the process of above Step 1012 (FIG. 8).

Here, the value of above K is set to the minimum integer equal to ormore than m/2 or to the maximum integer equal to or less than m/2, thatis, to an integer which minimizes the absolute value of the difference(m-2K) between K and (m-K). Alternatively, the value of above K is setso that the either K or (m-K) becomes the minimum value obtained byraising 2 to a certain power that is equal to or more than m/2. Thus,the number of logic stages in the case of constituting the circuit forobtaining the sum of partial products so that the adder is connected toform a well-balanced binary tree can be reduced.

FIG. 14 is a view showing the structure for performing the process ofabove Step 142 in terms of its function.

In the drawing, an input means 241 reads the circuit information on theinitial multiplier 191 as a functional element out of the circuit datastorage unit 23, and then outputs, to a means 242 for dividingmultiplier factor, the information which shows that the inputs to themultiplier 101 are the m-bit multiplier factor Y and the n-bitmultiplicand X. The input means 241 also outputs, to a means 244 forgenerating division calculating circuit, the information which showsthat the output from the multiplier 191 is the product P having the bitwidth of (m+n).

The means 242 for dividing multiplier factor initially calculates thevalue of K for dividing the multiplier factor Y, and then outputs, to ameans 243 for generating multiplication module, information on thesignal Y1 composed of the low-order K bits of the multiplier factor Y,multiplicand X, and partial product P1 and information on the signal Y2composed of the high-order (m-K) bits of the multiplier factor Y,multiplicand X, and partial product P2. The means 242 for dividingmultiplier factor also outputs respective sets of information on thepartial products P1 and P2 to the means 244 for generating divisioncalculating circuit. The names P1 and P2 of the foregoing partialproducts are allotted here by an allotting means (not shown).

The means 243 for generating multiplication module generates informationon the multiplier 192 which multiplies the multiplicand X by the signalY1 so as to obtain the partial product P1 and on the multiplier 193which multiplies the multiplicand X by the signal Y2 so as to obtain thepartial product P2, and then outputs the resulting information to anoutput means 245.

The means 244 for generating division calculating circuit outputs, tothe output means 245, information on a circuit consisting of a ripper194, mixer 195, and adder 196, which outputs, based on information onthe partial products P1 and P2 and information on the product P, thelow-order K bits of the partial product P1 as the low-order K bits ofthe product P while outputting the sum of the high-order (n-K) bits ofthe partial product P1 and partial product P2 as the high-order (n+m-K)bits of the product P.

The output means 245 stores the circuit information on the circuitobtained by conversion, which was outputted from the means 243 forgenerating multiplication module and from the means 244 for generatingdivision calculating means.

With the multiplier which performs multiplication by using variables asits multiplier factor and multiplicand, conversion is not limited to theforegoing process that involves division. It is also possible to allotthereto a general purpose multiplier entered in the library or toconvert it to a circuit using the 2-bit Booth's recode system, similarlyto the conventional automatic designing system.

In above Step 141, if it is determined that the multiplier factor is aconstant multiplier factor A, the process goes on to Step 143, where itis determined whether or not the posibits (A), which indicates thenumber of bits having the value of 1 in the multiplier factor A, is 2 orless. If the posibits (A) is 2 or less, the process goes on to Step 144.If the posibits (A) is 1, it must have been processed in above Step 1008or 1010, so that the determination of 2 or less is limited to the casewhere the posibits (A) is 2. In Step 143, the value of m may also bedetermined. If the posibits (A) is 2, two values obtained by shiftingthe multiplicand X depending on the bit positions are added, therebyconstituting a circuit for calculating partial products only withrespect to the bits having the value of 1. Such a circuit may be formedby a single process, but in this case, conversion is made to a circuithaving a (m-1)-bit multiplier which divides the multiplier factor A intothe most significant 1 bit and the low-order (m-1) bits, while addingthe product of the multiplicand X and the low-order (m-1) bits of themultiplier factor A and the value obtained by shifting the multiplicandX, so that recursive processing simplifies individual processes.However, if the most significant bit of the multiplier factor A is 0, itis sufficient to set the most significant bit of the product P to 0, sothat the circuit for performing addition or the like is not necessary.

Hence, in Step 144, which is shown in greater detail in FIG. 15, it isinitially determined in Step 161 whether or not the most significant bitof the multiplier factor A is 1. If it is 1, the process goes on to Step162, where conversion rule 3(a) shown in FIG. 16(a) is applied.Conversely, if it is 0, the process goes on to Step 163, whereconversion rule 3(b) shown in FIG. 16(b) is applied. The conversion rule3(a) and conversion rule 3(b) constitute conversion rule 3.

According to the conversion rule 3(a), a multiplier 151 is converted toa circuit consisting of a multiplier 152, ripper 153, and adder 154.

The multiplier 152 multiplies the multiplicand X (n-1:0) by thelow-order (m-1) bits A3=A (m-2:0) of the multiplier factor A, so as toobtain a partial product P3 (n+m-2:0) having the bit width of (n+m-1).

The ripper 153 divides the partial product P3 into the high-order n bitsP3 (n+m-2:m-1) and the low-order (m-1) bits P3 (m-2:0).

The adder 154 adds the foregoing P3 (n+m-2:m-1) and the multiplicand X(n-1:0) (logically, the product of the most significant bit of themultiplier factor A and the multiplicand X (n-1:0) as a partialproduct).

In the case where the process was performed, the value of posibits (A3)for the foregoing multiplier 152 becomes 1, so that the process of aboveStep 1008 or 1010 (FIG. 8) in the process of the next loop is performed.

The foregoing conversion rule 3(a) is stored in the design processstorage unit 21 in the internal representation form shown in FIG. 17. Inthe drawing, "Gate" of the condition clause precedent to "==>"corresponds to the multiplier 151 of FIG. 16. On the other hand, "Gate1" to "Gate 3" of the conclusion clause subsequent to "==>" correspondto the multiplier 152, ripper 153, and adder 154, respectively.

According to the conversion rule 3(b), the multiplier 151 is convertedto a circuit having a multiplier 155, which multiplies the multiplicandX (n-1:0) by the low-order (m-1) bits A3=A (m-2:0) of the multiplierfactor A, so that the obtained partial product having the bit width of(n+m-1) is outputted as the low-order (n+m-1) bits P (n+m-2:0) of theproduct P, while the value P (n+m-2) is outputted as the mostsignificant bit P (n+m-1) of the product P. In this case, therefore, themultiplier 151 can be converted to a circuit including the multiplierhaving a reduced bit width without increasing the number of the partialproducts. In the case where the process was performed, the value ofposibits (A3) for the multiplier 152 remains 2, so that Step 144 isexecuted again in the process of the next loop and conversion is made toa circuit which includes a multiplier having a further reduced bit widthin Step 163, or conversion is made to a circuit which includes amultiplier having one bit the value of which is 1 in Step 162.

Instead of dividing the multiplier factor A into the most significant 1bit and the low-order (m-1) bits, as described above, it is alsopossible to divide the multiplier factor A into the high-order (m-1)bits and the least significant bit.

FIG. 18 is a view showing the structure for performing the process ofabove Step 144 in terms of its function.

In the drawing, an input means 251 reads the circuit information on theinitial multiplier 151 as an functional element out of the circuit datastorage unit 23 and outputs, to a means 252 for separating the mostsignificant bit, information which shows that the inputs to themultiplier 151 are the m-bit multiplier factor A and the n-bitmultiplicand X and that the output from the multiplier 151 is theproduct P having the bit width of (m+n).

The means 252 for separating the most significant bit separates the mostsignificant bit A (m-1) of the multiplier factor A from the low-orderbits A (m-2:0) thereof and outputs, to a means 253 for determining bitvalue, information on the most significant bit A (m-1), multiplicand X,and product P, while outputting, to a means 254 for generatingmultiplication module, information on the lower bits A (m-2:0) andmultiplicand X.

The means 258 for determining bit value determines whether the value ofthe most significant bit A (m-1) is 1 or 0 and outputs, to the means 254for generating multiplication module, the information showing that theresult of multiplying the multiplicand X by the low-order bits A (m-2:0)is the partial product P3 or the product P (n+m-2:0), depending on theresult of determination. If the value of the most significant bit A(m-1) is 1, information on the multiplicand X, product P, and partialproduct P3 is outputted to a means 255 for generating add shiftcalculating circuit. Conversely, if the value of the most significantbit A (m-1) is 0, information on the most significant bit P (n+m-1) ofthe product P and information on the value P (n+m-2) is outputted to ameans 256 for generating circuit.

The means 254 for generating multiplication module generates informationon the multipliers 152 and 155 which multiply the multiplicand X by thelow-order bits A (m-2:0) of the multiplier factor A so as to output theresult as the partial product P3 or product P (n+m-2:0), and outputs theresulting information to an output means 257.

The means 255 for generating add shift calculating circuit generatesinformation on a circuit consisting of the ripper 153 and adder 154,which outputs, in the case where the value of the most significant bit A(m-1) of the multiplier factor A is 1, the low-order (m-1) bits of thepartial product P3 as the low-order (m-1) bits P (m-2:0) of the productP, while outputting the sum of the high-order n bits of the partialproduct P3 and multiplicand X as the high-order (n+1) bits P (n+m-1:m-1)of the product P, based on information on the partial product P3,information on the multiplicand X, and information on the product P. Theresulting information is then outputted to the output means 257.

On the other hand, the means 256 for generating circuit generatesinformation on a circuit, which outputs, in the case where the value ofthe most significant bit of the multiplier factor A is 0, the value P(n+m-2) as the most significant bit P (n+m-1) of the product P. Theresulting information is outputted to the output means 257.

The output means 257 stores in the circuit data storage unit 23 the setsof circuit information on the circuit obtained by conversion, which areoutputted from the respective means 254 to 256.

If it is determined in above Step 143 that the posibits (A) in theconstant multiplier factor A is more than 2, the process goes on to Step145, where it is further determined whether or not the posibits (A) islarger than the negabits (A)+1. The negabits (A) indicates the number ofbits having the value of 0.

In Step 145, if it is determined that the posibits (A) is not largerthan the negabits (A)+1, the process goes on to Step 146. In Step 146,the conversion rule 2 shown in FIG. 13 is applied, similarly to the caseof above Step 142 where the multiplier factor is a variable, so as todivide the multiplier factor A and conversion is made to a circuitincluding two multipliers. However, unlike the case where the multiplierfactor is a variable, the value of K for dividing the multiplier factorA used here is not about 1/2 of the bit width of the multiplier factorA. Instead, the value of effbitwidth (A, L) is used. The effbitwidth (A,L) is defined as a value obtained by calculating the number of bitshaving the value of 1 from the least significant bit of the multiplierfactor A till it becomes L, if L is the minimum integer equal to or morethan the posibits (A)/2. The value of above L may be the maximum integerequal to or less than the posibits (A)/2. or a number obtained byraising 2 to a certain power which is close to the maximum integer,similarly to the value of above K.

In the multiplier in which the multiplier factor A is divided and theposibits (A) becomes 2 or less by repeatedly performing the process ofStep 146 once, twice, or more than twice, a circuit for calculatingpartial products only with respect to the bits having the value of 1 isproduced in Step 1006 of FIG. 8 or in Step 144 of FIG. 12, as describedabove. By dividing the multiplier factor so that the numbers of bitshaving the value of 0 becomes substantially equal, the number of logicstages in the case of constituting a circuit for calculating the sum ofpartial products by connecting the adder so as to form a well-balancedbinary tree can be reduced.

If the posibits (A) is 3, the number of logic stages always becomes 2 nomatter how the multiplier factor A is divided. Therefore, it is alsopossible to determine whether or not the posibits (A) is 3 or less inStep 143, and to divide the multiplier factor A into the mostsignificant 1 bit and the low-order (m-1) bits in Step 144, if theposibits (A) is 3.

The structure for performing the process of above Step 146 is the sameas the structure of FIG. 14 corresponding to above Step 142, except thatthe manners to determine the value of K for dividing the multiplierfactor A are different.

Conversely, if it is determined that the posibits (A) is larger than thenegabits (A)+1 in Step 145, the process proceeds to Step 147, whereconversion rule 4 shown in FIG. 19 is applied so that conversion is madeto a circuit including a multiplier for obtaining the product of amultiplier factor A0, which is obtained by inverting all the bits in themultiplier factor A by the logic NOT operation, and the multiplicand X.In the multiplier included in the circuit after conversion, the value ofthe posibits (A) and the value of the negabits (A) are switched, so thatin the process of the next loop, the answer obtained in Step 145, forexample, becomes "no", resulting in conversion whereby the multiplier A0is divided in Step 146. Consequently, the circuit for obtaining partialproducts only with respect to the bits having the value of 0 is producedwhile the number of bits having the value of 1 is reduced compared withthat of the multiplier factor A, so that the number of circuits forcalculating the partial products and the number of logic stages in thecircuits for calculating the sum of the partial products are reduced.

In order to obtain the product of the multiplier factor A and themultiplicand X, however, it is necessary to correct the product of themultiplier factor A0 and the multiplicand X. According to the foregoingconversion rule 4, conversion is made to a circuit which also includes acircuit for correction.

In FIG. 19, numeral 171 denotes a multiplier prior to conversion.

A multiplier 172 multiplies the multiplicand X by the foregoingmultiplier factor A0 and outputs a product P0 (=X*A0) having the bitwidth (n+m).

An inverter 178 inverts all the bits in the product P0 by the logic NOToperation and outputs a signal having the bit width of (n+m).

The mixer 173 gathers a signal by using the multiplicand X as itshigh-order n bits and an m-bit signal having the value of 0 as itslow-order m bits, so as to output the resulting signal R2 (=X*2^(m))having the bit width of (n+m).

The mixer 174 gathers a signal by using an m-bit signal in which eachbit has the value X (n-1), which is the value of the most significantbit of the multiplicand X as its high-order m bits and the logic NOTnumber of the foregoing multiplicand X as its low-order n bits, so as tooutputs the resulting signal having the bit width of (n+m).

An inverter 177 inverts all the bits in an output from the mixer 174 bythe logic NOT operation and outputs a signal R3 (=-X-1) having the bitwidth of (n+m).

An adder 175 receives the signal R2, signal R3, and a carry having thevalue of 1 as its inputs, and outputs their sum R4 (=X*(2^(m) -1))having the bit width of (n+m).

An adder 176 receives the logic NOT number of the product P0, the sumR4, and a carry having the value of 1 as its inputs, and outputs theirsum R5 (=X*(2^(m) -1)-P0) having the bit width of (n+m) as the productP.

The requirement on determination in above Step 145 is not limited to:posibits (A)>negabits (A)+1. It can be: posibits (A)≧m/2 or the like. Inconsideration of the sizes of the individual circuits for the foregoingcorrection, it is also possible for the process to go on to Step 147only when the value of posibits (A) is larger.

FIG. 20 is a view showing the structure for performing the process ofabove Step 147 in terms of its function.

An input means 231 reads circuit information on the initial multiplier171 as a functional element out of the circuit data storage unit 23 andoutputs, to a means 232 for generating logic NOT, information whichshows that the inputs to the multiplier 171 is the m-bit multiplierfactor A and n-bit multiplicand X. The input means also outputs, to ameans 234 for generating logic NOT calculating circuit, information onthe foregoing multiplicand X and information which shows that the outputfrom the multiplier 171 is the product P having the bit width of (m+m).

The means 232 for generating logic NOT outputs, to a means 233 forgenerating multiplication module, information on an inverter 179 foroutputting the multiplier factor A0 by inverting all the bits in themultiplier factor A by the logic NOT operation, information on theforegoing multiplier factor A0, information on the multiplicand X, andinformation which shows that the result of multiplying the multiplicandX by the multiplier factor A0 is a product P0. The means 232 forgenerating logic NOT also outputs, to the means 234 for generating logicNOT calculating circuit, information on the foregoing product P0.

The means 233 for generating multiplication module generates informationon a multiplier 172 for calculating the product P0 of the multiplierfactor A0 and multiplicand X and outputs it to an output means 235.

The logic NOT calculating circuit generating means 234 generatesinformation on the circuits 178 and 138 which output the product PO byproviding a signal R5 (=X*(2^(m) -1)-P0), based on the foregoing productP0 and multiplicand X, by subtracting the product P0 from a product R4(=X*(2^(m) -1)) of the multiplicand X and (2^(m) -1), and outputs it tothe output means 235.

The output means 235 stores in the circuit data storage unit 23 circuitinformation on the circuit after conversion, which was outputted fromthe means 232 to 234.

Below, it will be proved by numerical expressions that the initialmultiplier can be converted to an equivalent circuit in accordance withthe foregoing conversion rules 1 to 4.

Conversion Rule 1 (see FIGS. 10(a), 10(b), and 10(c))

In FIG. 10(b), numeral 132 denotes an AND circuit for calculating alogic product P(n-1) of a 1-bit multiplicand X(n-1) and a 1-bit variablemultiplier factor Y(0), numeral 133 denotes an AND circuit forcalculating a logic product P(n-2) of a 1-bit multiplicand X(n-2) and a1-bit variable multiplier factor Y(0), . . . numeral 134 denotes an ANDcircuit for calculating a logic product P(1) of a 1-bit multiplicandX(1) and a 1-bit variable multiplier factor Y(0), and numeral 135denotes an AND circuit for calculating a logic product P(0) of a 1-bitmultiplicand X(0) and a 1-bit variable multiplier factor Y(0). SinceY(0)=0 or 1, ##EQU3##

Here, since each of Y(0) and P(i) is composed of 1 bit, X(i)*Y(0)=X(i)and Y(0).

Therefore,

    P(i)=X(i) and Y(0)(0≦i≦n-1)

    P(n)=P(n-1)

Conversion rule 2 (see FIG. 13) ##EQU4##

Hence,

    P(K-1:0)=P1(K-1:0)

    P(n+m-1:K)=R2(n+m-K-1:0).

The same result was obtained when the multiplier factor A is a constant.

Conversion Rule 3(a) (see FIG. 16(a)) ##EQU5##

Hence,

    P(m-2:0)=P3(m-2:0)

    P(n+m-1:m-1)=R1(n:0)

Conversion Rule 3(b) (see FIG. 16(b)) ##EQU6##

Hence,

    P(n+m-2:0)=P3(n+m-2:0)

    P(n+m-1)=P(n+m-2)

Conversion Rule 4 (see FIG. 19))

Below, the logic NOT number obtained by inverting all the bits in amultiple-bit number Z by the logic NOT operation will be represented by#Z.

For the constant A.

    -A=#A+1-2.sup.m ←→#A+1=2.sup.m -A.

For an n-bit number X, (two's complement of X)=#X+1=-X.

Therefore, ##EQU7##

Hence,

    X*A=X*2.sup.m +#X+1+#P0+1

The first term X*2^(m) of the foregoing equation can be obtained as R2by the mixer 173.

The second term X can be obtained as R3 by the mixer 174 and inverter177 through sign extension and inversion of all the bits by the logicNOT operation.

The fourth term P0 can be obtained by the multiplier 172 and inverter178.

The addition of the first term X*2^(m), second term X, and 1 as thethird term or fifth term can be performed by the adder 175, thusproviding the sum R4. Since X*A is a number having the bit width of(n+m), it is not necessary to consider the (n+m+1)-th bit position inthe addition result.

The addition of said R4, the fourth term P0, and 1 as the third term orfifth term can be performed by the adder 176, thus providing the sum R5.Since X*A is a number having the bit width of (n+m), it is not necessaryto consider the (n+m+1)-th bit position in the addition result.

Hence, ##EQU8##

As described above, with the system for automatically designing logiccircuits of the first embodiment, if the multiplier factor inputted tothe multiplier is a constant and if the total number of bits having thevalue of 1 is 3 or more, the multiplier factor is divided into two partsso that each part includes the equal number of bits having the valueof 1. Consequently, the circuit for calculating the sum of the partialproducts is structured in a well-balanced binary tree, and it becomespossible to reduce the number of logic stages and provide higher-speedmultiplication.

If the total number of the bits having the value of 1 is 2 or less, acircuit for calculating partial products only with respect to the bitshaving the value of 1 is constituted, thereby reducing the number ofpartial products and circuit area.

When the total number of the bits having the value of 1 is large, amultiplier for multiplying the multiplicand by the logic NOT number ofthe multiplier factor and a circuit for correcting the multiplicationresult are constituted, thereby reducing the number of partial productsand circuit area.

EXAMPLE 2

A variation of the structure for performing the same process as that ofStep 1013 of FIG. 8, i.e., the process of Steps 141 through 147 of FIG.12 will be described with reference to FIG. 21.

In FIG. 21, an input means 2901 reads circuit information on the initialmultiplier as functional element out of the circuit data storage unit 23and outputs, to a means 2902 for judging logic NOT 2902, informationwhich shows that the inputs to the multiplier are the m-bit multiplierfactor A or Y and the n-bit multiplicand X and that the output from themultiplier is the product P having the bit width of (m+n).

The means 2902 for judging logic NOT judges whether or not the posibits(A) is larger than the negabits (A)+1. If the answer is yes, informationon the multiplier factor A or Y, multiplicand X, and product P isoutputted to a means 2904 for generating logic NOT. Conversely, if theanswer is no, the foregoing information is outputted to a means 2903 fordetermining the bit width of multiplier factor.

The means 2903 for determining the bit width of multiplier factordetermines whether or not the multiplier factor is a variable, whetheror not the multiplier factor is a constant and the posibits (A) is 3 ormore, or whether or not the multiplier factor is a constant and theposibits (A) is 2 or less.

When the multiplier factor is a variable or when the multiplier factoris a constant and the posibits (A) is 3 or more, the information on themultiplier factor A or Y, multiplicand X, and product P is outputted toa means 2907 for dividing multiplier factor. On the other hand, if themultiplier factor is a constant and the posibits (A) is 2 or less, theinformation on the multiplier factor A or Y, multiplicand X, and productP is outputted to a means 2909 for separating the most significant bitof multiplier.

Other means 2904 to 2913 have the same functions as those of the meansshown in FIGS. 14, 18, and 20, except that their information transferpath is slightly different, so that the description thereof will beomitted.

EXAMPLE 3

Another example of the process performed in Step 1013 of FIG. 8 in thefirst embodiment will be described with reference to FIG. 22.

In the present embodiment, if the bit width of the multiplier factor is3 or more, the multiplier factor is divided into two parts so that eachpart has the bit width of about 1/2, whether the multiplier factor is aconstant or variable. If the bit width of the multiplier factor is 2 andif the multiplier factor is a constant, the foregoing conversion rule 3(see FIGS. 16(a) and 16(b)) is applied, so that conversion is made to acircuit for calculating partial products only with respect to the bitshaving the value of 1. On the other hand, if the multiplier factor is avariable, a circuit including two multipliers which use a 1-bitmultiplier factor is constituted.

In Step 211, it is determined whether the bit width of the multiplierfactor is 3 or more. If it is 3 or more, the process goes on to Step212, where the foregoing conversion rule 2 (see FIG. 13) is applied sothat conversion is made to a circuit including two multipliers in whichthe bit width of the multiplier factor is about 1/2.

If the bit width of the multiplier factor is less than 3, the processgoes on to Step 213, where it is determined whether or not themultiplier factor is a constant. If it is a constant, the process goeson to Step 214, where the foregoing conversion rule 3 (see FIGS. 16(a)and 16(b)) is applied so that conversion is made to a circuit forcalculating partial products only with respect to the bits having thevalue of 1 in the multiplier factor.

Conversely, if the multiplier factor is a variable, the process goes onto Step 215, where conversion rule 5 shown in FIG. 23 is applied.

The conversion rule 5 shows that a multiplier 221 is converted to acircuit consisting of multipliers 222 and 223, ripper 224, mixer 225,and adder 226.

The foregoing multiplier 222 multiplies the multiplicand X(n-1:0) by thelow-order 1 bit A(0) of the multiplier factor A (1:0), so as tocalculate the partial product R1(n:0) having the bit width of (n+1).

The multiplier 223 multiplies the multiplicand X(n-1:0) by thehigh-order 1 bit A(1) of the multiplier factor A (1:0), so as tocalculate the partial product R2 (n+1:1) having the bit width of (n+1).

The ripper 224 divides the partial product R1(n:0) into the high-order nbits R1(n:1) and the low-order 1 bit R(0), so as to output R(0) as theproduct P(0).

The mixer 225 outputs a signal R3(n+1:1) which is obtained by extendingthe sign of above R1(n:1) by 1 bit to the higher order.

The adder 228 adds the signal R3(n+1:1) and partial product R2(n+1:1) soas to output the sum R4(n+1:1) as the product P(n+1:1).

Below, it will be proved that the initial multiplier 221 can beconverted to an equivalent circuit according to the foregoing conversionrule 5. ##EQU9##

Hence,

    P(0)=R1(0)

    P(n+1:1)=R4(n:0)

When the process is performed, the bit width of the multiplier factor inthe multipliers 222 and 223 becomes 1 bit, so that conversion is made toa circuit consisting of AND circuits in the process of the next rule,according to the foregoing conversion rule 1 (see FIGS. 10(a), 10(b),and 10(c)).

According to the present embodiment 3, if the bit width of themultiplier factor in the multiplier is 3 or more, it becomes possible tostructure the circuit for calculating partial products in a binary treeby dividing the multiplier factor, so that the number of logic stages inmultiplication can be reduced and the speed of multiplication can beincreased.

On the other hand, if the bit width of the multiplier factor is 2 orless and if the multiplier factor is a constant, it becomes possible toreduce the number of partial products and circuit area by generating thecircuit for calculating partial products only with respect to the bitshaving the value of 1 in the multiplier factor.

EXAMPLE 4

Although Step 144 (see FIG. 12) of the foregoing first embodiment andStep 214 (see FIG. 22) of the third embodiment show an example in whichthe conversion rule 3 for separating the most significant bit of themultiplier factor A is applied to the 2-bit multiplier in which theposibits (A)=2, it is possible to apply conversion rule 6 for dividingthe multiplier bit, factor into three parts of a specified K-th bit, thehigh-order bits, and the low-order bit. It is also possible to apply theconversion rule 6 instead of the conversion rule 2 in Step 146 (see FIG.12) or in Step 212 (see FIG. 22). In this case, the determination inStep 143 or Step 211 may be omitted.

First, as shown in FIG. 24, it is determined whether or not the value ofthe K-th bit A(K-1) in the multiplier factor A is 1 in Step 311. If itis 1, the process goes on to Step 312, where conversion rule 6(a) shownin FIG. 25(a) is applied. On the other hand, if it is 0, the processgoes on to Step 313, where conversion rule 6(b) shown in FIG. 25(b) isapplied. The conversion rules 6(a) and 6(b) constitute the conversionrule 6. As for the value of above K, it can be set similarly to that of,e.g., the first embodiment.

The conversion rule 6(a) shows that a multiplier 281 is converted to acircuit consisting of multipliers 282 and 283, mixers 284 to 287, andadder 288.

The multiplier 282 multiplies the multiplicand X(n-1:0) by the low-order(K-1) bits AS(K-2:0)=A(K-2:0) in the multiplier factor A, so as tocalculate the partial product P5(n+K-2:0) having the bit width of(n+K-1).

The multiplier 283 multiplies the multiplicand X(n-1:0) by thehigh-order (m-K) bits A6(m-K-1:0)=A(m-1:K) of the multiplier factor A,so as to calculate the partial product P6(n+m-K-1:0).

The mixer 284 outputs a signal R1(n+m-1:0) which is obtained byextending the sign of the partial product P5(n+K-2:0) by (m-K+1) bits tothe higher order.

The mixer 285 outputs a signal R2(n+m-1:0) which is a K-bit signalhaving the value of 0 gathered in the lower order of the partial productP6.

The mixer 286 outputs a signal R3(n+K-2:0) which is obtained bygathering a signal having the value of 0 and the bit width of (K-1) inthe lower order of the multiplicand X(n-1:0).

The mixer 287 outputs a signal R4(n+m-1:0) which is obtained byextending the sign of the foregoing signal R3(n+K-2:0) by (m-K+1) bitsto the higher order.

The adder 288 adds the foregoing signal R1(n+m-1:0), signal R2(n+m-1:0),and signal R4(n+m-1:0) so as to output the product P(n+m-1:0).

The conversion rule 6(b) shows that the multiplier 281 is converted to acircuit consisting of the multipliers 282 and 283, mixers 284 and 287,and an adder 289.

The foregoing adders 282 and 283 and mixers 284 and 287 are the same asshown in the conversion rule 6(a). The adder 289 adds the signalR1(n+m-1:0) and signal R2(n+m-1:0) so as to output the productP(n+m-1:0).

Below, it will be proved that the initial multiplier 281 can beconverted to an equivalent circuit according to the foregoing conversionrule 6.

Conversion Rule 6(a)

Since A (K-1)=1, ##EQU10## Conversion Rule 6(b) Since A (K-1)=0,##EQU11##

EXAMPLE 5

Although Step 144 (see FIG. 12) of the first embodiment and Step 214 ofthe third embodiment show an example in which the conversion rule 3 isapplied to the 2-bit multiplier in which the posibits (A)=2 in themultiplier factor A, it is also possible to apply conversion rule 7shown in FIG. 26 instead.

The conversion rule 7 shows that a multiplier 271 is converted to acircuit consisting of a multiplier 272, mixers 273 and 274, and adder275.

The multiplier 272 multiplies the multiplicand X by an m-bit multiplierfactor A7 (m-1:0) which is obtained by setting the K-th bit (0≦K≦m-1)having the value of 1 in the multiplier factor A(m-1:0) to 0, so as tooutput the product P7(n+m-1:0).

The mixer 273 gathers a signal by using the multiplicand X as thehigh-order n bits and by using a signal having the value of 0 and thebit width of (K-1) as the low-order (K-1) bits and outputs the resultantsignal R1(n+K-2:0) having the bit width of (n+K-1).

The mixer 274 gathers a signal having the bit width of (m-K+1) in whicheach bit has the value of R1(n+k-2) in the higher order of the foregoingsignal R1(n+K-2:0) by extending the sign of the signal R1 and outputsthe resulting signal R2(n+m-1:0) having the bit width of (n+m).

The adder 275 adds the product P7(n+m-1:0) and signal R2(n+m-1:0), so asto output the sum R3(n+m-1:0) as the product P(n+m-1:0).

Below, it will be proved that the initial multiplier 271 can beconverted to an equivalent circuit according to the foregoing conversionrule 7.

Since A7 (m-1:0)=A (m-1:0)-2^(K-1), ##EQU12##

In this case, the bit width of the multiplier factor A7(m-1:0) inputtedto the multiplier 272 is equal to the bit width of the multiplier factorA (m-1:0) inputted to the multiplier 271. However, since the number ofthe bits having the value of 1 is decreased, if the process isrepeatedly performed, the process of above Step 1008 or Step 1010 (seeFIG. 8) will eventually be implemented.

FIG. 27 is a view showing the structure for performing the foregoingconversion rule 7 in terms of its function.

An input means 261 reads circuit information on the initial multiplieras a functional element out of the circuit data storage unit 23 andoutputs information, to a means 262 for generating signal, informationwhich shows that the inputs to the multiplier 271 are the m-bitmultiplier factor A and n-bit multiplicand X. The input means 261 alsooutputs, to a means 264 for generating calculating circuit, informationon the multiplicand X and information which shows that the output fromthe multiplier 271 is the product P having the bit width of (m+n).

The means 262 for generating signal outputs, to a means 263 forgenerating calculation module, information on a multiplier factor A7which is obtained by turning the K-th bit (0≦K≦m-1), having the value of1, in the multiplier factor A to 0, information on the multiplicand X,and information which shows that the multiplication result is a productP7. The means 262 for generating signal also outputs information on thevalue of above K and information on the product P7 to the means 264 forgenerating calculating circuit.

The means 263 for generating calculation module generates information onthe multiplier 272 for calculating the product P7 of the foregoingsignal X and signal A7 and outputs the resulting information to anoutput means 265.

The means 264 for generating calculating circuit outputs, based on theinformation on the value of K, the information on the product P7,information on the multiplicand X, and information on the product P,information on mixers 276 and 274 and on a multiplier 275 to the outputmeans 265.

The output means 265 stores in the circuit data storage unit 23 circuitinformation on the circuit obtained by conversion, which was outputtedfrom the means 263 for generating multiplication module and from themeans 264 for generating calculating circuit.

EXAMPLE 6

Other examples of the foregoing conversion rule 4 and the structures ofmultipliers which are generated in accordance with the examples will bedescribed. Although the present embodiment shows the case in which thevariable X is a positive number for simplicity, if the variable X can bepositive or negative number, it is possible to calculate the logic NOTnumber after sign extension, similarly to the conversion 4, or toperform sign extension after calculating the logic NOT number.

FIGS. 28(a) to 28(c) show the conclusion clauses of the conversion rulesas well as the structures of multipliers generated. Since the componentsshown in FIGS. 28(a) to 28(c) are the same as shown in FIG. 19, thedescription thereof will be omitted by providing the same numerals.

In the multiplier of FIG. 28(a), a signal having the value of 1 isinputted to the mixer 173 as an m-bit signal instead of a signal havingthe value of 1 being inputted to the multiplier 175 as a carry.

In the multiplier of FIG. 28(b), a signal having the value of 1 isinputted to the mixer 173 as an m-bit signal instead of a signal havingthe value of 1 being inputted to the multiplier 176 as a carry.

If the bit width m of the multiplier factor is 2 or more, it is possibleto input a signal having the value of 2 to the mixer 17 as an m-bitsignal, instead of inputting a signal having the value of 1 as a carry,as shown in FIG. 28(c).

Thus, the calculation for obtaining the product P by correcting theproduct P0 can be modified in various manners.

In the foregoing multipliers, any multiplier included therein isdesigned to multiply the multiplicand X by the multiplier factor A0,which is the value obtained by inverting all the bits in the multiplierA by the logic NOT operation. Consequently, even when posibits (A) islarger than m/2, it is possible to reduce circuit area and increase thespeed of multiplication by reducing the number of partial products tom/2 or less.

In each of the foregoing embodiments, circuit information stored in thecircuit data storage unit 23 has been described in informationrepresentation which represents circuits in terms of functionalelements, logic elements, and mounted elements, and more specifically,in terms of inputs and outputs to and from these elements. However, thepresent invention is not limited thereto, and it is also possible toperform a process of converting circuits in accordance with similarconversion rules, even if information representation based on therelationships among the elements, namely signals, is used instead.

The conversion process is not limited to the process of convertingcircuits in accordance with the foregoing conversion rules, either. Theconversion process can be a process of sequentially generating andentering parts of circuit information in a specified order.

Although the foregoing embodiments have described the case in which theproduct P of the m-bit multiplier factor and n-bit multiplicand has thebit width of (n+m), it is easily attainable to more commonly calculate aproduct having a given bit width. For example, if the bit width l of theproduct P is less than (n+m), the low-order l bits of the multiplicationresult are used as the product P. Conversely, if the bit width l of theproduct P is more than (n+m), the multiplication result having the bitwidth of (n+m) is used as the low-order bits, while the high-order bitsare subjected to sign extension, so as to provide the product P.

We claim:
 1. A method of automatically designing a logic circuit forgenerating a multiplier M which receives an n-bit number X and an m-bitconstant A as its inputs and outputs their product P, comprising thesteps of:(a) if an integer K is 0<K<m, generating a multiplier M1 whichreceives A1, composed of the low-order K bits of A, and X as its inputs,and outputs the product P1 of A1 and X; (b) generating a multiplier M2which receives A2, composed of the high-order (m-K) bits of A, and X asits inputs, and outputs the product P2 of A2 and X; (c) generating acircuit which receives P1 and P2 as its inputs, and outputs the sum ofP1 and the product of P2 and 2^(K), wherein steps (a) to (c) areexecuted to generate said multiplier M; and (d) determining the value ofsaid integer K, based on the number L1 of the bits having the value of 1in said constant A1 and on the number L2 of the bits having the value of1 in said constant A2.
 2. A method of automatically designing a logiccircuit according to claim 1, wherein the value of said integer K isdetermined so that the absolute value of the difference between said L1and L2 is minimized in said step (d).
 3. A method of automaticallydesigning a logic circuit for generating a multiplier M which receivesan n-bit number X and an m-bit constant A as its inputs and outputstheir product P, comprising the steps of:(a) calculating a constant A7defined as A7=A=2^(K) with respect to a bit position K (0≦K≦m-1) havingthe value of 1 in said constant A; (b) generating a multiplier M7 whichreceives said A7 and X as its inputs and outputs the product P7 of saidA7 and X; and (c) generating a circuit which receives said X and P7 asits inputs and outputs the sum of said P7 and the product of said X and2^(K), wherein said steps (a) to (c) are executed so as to generate saidmultiplier M.
 4. A method of automatically designing a logic circuitaccording to claim 3, wherein said K is 0 or (m-1).
 5. A method ofautomatically designing a logic circuit according to claim 3, whereinsaid steps (a) to (c) are recursively executed with respect to saidmultiplier M7 generated in said step (b), so as to generate saidmultiplier M.
 6. A method of automatically designing a logic circuit forgenerating a multiplier M which receives an n-bit number X and an m-bitconstant A as its inputs and outputs their product P, comprising thesteps of:(a) if an integer K is 0<K<m-1, generating a multiplier M5which receives a constant A5 composed of the low-order (K-1) bits ofsaid constant A and said X as its inputs and outputs their produce P5;(b) generating a multiplier M6 which receives a constant A6 composed ofthe high-order (m-K) bits of said constant A and said X as its inputsand outputs their product P6; (c) if the K-th bit from the leastsignificant bit in said constant A has the value of 1, generating acircuit which receives said X, P5, and P6 as its inputs and outputs thesum of the product of said X and 2^(K-1), the product of said P6 and2^(K), and said P5; and (d) if the K-th bit from the least significantbit in said constant A has the value of 0, generating a circuit whichreceives said P5 and P6 as its inputs and outputs the sum of said P5 andthe product of said P6 and 2^(K), wherein said steps (a) to (d) areexecuted so as to generate said multiplier M.
 7. A method ofautomatically designing a logic circuit according to claim 6, whereinsaid steps (a) to (d) are recursively executed with respect to saidmultipliers M5 and M6 generated in said steps (a) and (b), so as togenerate said multiplier M.
 8. A method of automatically designing alogic circuit for generating a multiplier M which receives an n-bitnumber X and m-bit constant A as its inputs and outputs their product P,comprising the steps of:(a) generating a circuit which receives saidconstant A and number X as its inputs and outputs the product P0 of theone's complement A0 of said constant A and said X; (b) generating acircuit which receives said X as input and outputs the sum Q4 of thetwo's complement of said X and the product of said X and 2^(m) ; and (c)generating a circuit which receives said P0 and Q4 as its inputs andoutputs the sum of the two's complement Q0 of said P0 and said Q4;wherein said steps (a) to (c) are executed so as to generate saidmultiplier M.
 9. A method of automatically designing a logic circuitaccording to claim 8, wherein said step (a) further comprises the stepsof:(a-1) determining whether or not the number L11 of the bits havingthe value of 1 in said constant A is larger than a specified integer K(0<K<m); and (a-2) if said number L11 of the bits is determined to belarger than K in said step (a-1), generating a circuit which receivessaid constant A and said X as its inputs and outputs the product P0 ofthe one's complement A0 of said constant A and said X.
 10. A method ofautomatically designing a logic circuit for generating a multiplier Mwhich receives an n-bit number X and an m-bit constant A as its inputsand outputs their product P, the method comprising the step of:dependingon said constant A, selectively executing operation S or T to generatesaid multiplier M, wherein said operation S comprises the steps of:(a)if an integer K is 0<K<m, generating a multiplier M1 which receives aconstant A1 composed of the low-order k bits of said constant A and saidn-bit number X as its inputs, and outputs the product P1 of saidconstant A1 and n-bit number X; (b) generating a multiplier M2 whichreceives a constant A2 composed of the high-order (m-k) bits of saidconstant A and said n-bit number X as its inputs, and outputs theproduct P2 of said constant A2 and n-bit number X; and (c) generating acircuit which receives said P1 and P2 as its input, and outputs the sumof said P1 and the product of said P2 and 2^(K), and said operation Tcomprises the steps of:(a) calculating a constant A7 defined asA7=A-2^(K) with respect to a bit position K (0≦K≦m-1) having the valueof 1 in said constant A; (b) generating a multiplier M7 which receivessaid constant A7 and n-bit number X as its inputs and outputs theproduct P7 of said constant A7 and n-bit number X; and (c) generating acircuit which receives said n-bit number X and product P7 as its inputs,and outputs the sum of said product P7 and the product of said n-bitnumber X and 2^(K).
 11. A method of automatically designing a logiccircuit according to claim 10, wherein,if a number L11 of the bitshaving the value of 1 in said constant A is larger than 3, saidoperation S is selected, while, if said number L11 is smaller than 2,said operation T is selected.
 12. A method of automatically designing alogic circuit according to claim 10, wherein,if the bit width m of saidconstant A is larger than 3, said operation S is selected, while, ifsaid m is smaller than 2, said operation T is selected.
 13. A method ofautomatically designing a logic circuit according to claim 10,whereinwhen said operation S is selected, said operation S isrecursively executed with respect to each of said multipliers M1 and M2,and when said operation T is selected, said operation is recursivelyexecuted with respect to said multiplier M7.
 14. A method ofautomatically designing a logic circuit according to claim 10, whereinsaid K is an integer which minimizes the absolute value of thedifference between K and (m-K).
 15. A method of automatically designinga logic circuit according to claim 10, further comprising the stepofdetermining the value of said integer K, based on a number L1 of thebits having the value of 1 in said constant A1 and on a number L2 of thebits having the value of 1 in said constant A2.
 16. A method ofautomatically designing a logic circuit according to claim 15,whereinthe value of said integer K is determined so as to minimize theabsolute value of the difference between the number L1 of the bitshaving the value of 1 in said constant A1 and the number L2 of the bitshaving the value of 1 in said constant A2.
 17. A method of automaticallydesigning a logic circuit for generating a multiplier M which receivesan n-bit number X and an m-bit constant A as its inputs, and outputstheir product P, the method comprising the steps of:depending on saidconstant A, selectively executing operation S, T or U to generate saidmultiplier M, wherein said operation S comprises the steps of:(a) if aninteger K is 0<K<m, generating a multiplier M1 which receives a constantA1 composed of the low-order k bits of said constant A and said n-bitnumber X as its inputs, and outputs the product P1 of said A1 and n-bitnumber X; (b) generating a multiplier M2 which receives a constant A2composed of the high-order (m-k) bits of said constant A and said n-bitnumber X as its inputs, and outputs the product P2 of said A2 and n-bitnumber X; and (c) generating a circuit which receives said product P1and product P2 as its input, and outputs the sum of said product P1 andthe product of said product P2 and 2^(K), said operation T comprises thesteps of:(a) calculating a constant A7 defined as A7=A-2^(K) withrespect to a bit position K (0≦K≦m-1) having the value of 1 in saidconstant A; (b) generating a multiplier M7 which receives said constantA7 and n-bit number X as its inputs, and outputs the product P7 of saidconstant A7 and X; and (c) generating a circuit which receives saidn-bit number X and product P7 as its inputs, and outputs the sum of saidP7 and the product of said n-bit number X and 2^(K), and said operationU comprises the steps of:(a) generating a circuit which receives saidconstant A and n-bit number X as its inputs and outputs the product P0of the one's complement A0 of said constant A and said n-bit number X;(b) generating a circuit which receives said n-bit number X as itsinput, and outputs the sum Q4 of the two's complement of said X and theproduct of said X and 2^(m) ; and (c) generating a circuit whichreceives said product P0 and sum Q4 as its inputs, and outputs the sumof the two's complement Q0 of said product P0 and said sum Q4.
 18. Amethod of automatically designing a logic circuit according to claim 17,wherein,if a number L11 of the bits having the value of 1 in saidconstant A is larger than 3 and if said number L11 is larger than anumber L00 of the bits having the value of 0 in said constant A, saidoperation U is selected or if said L11 is larger than 3 and if said L11is smaller than said L00, said operation S is selected, while, if saidL11 is smaller than 2, said operation T is selected.
 19. A method ofautomatically designing a logic circuit according to claim 17,wherein,if the bit width m of said constant A is larger than 3 and ifthe number L11 of the bits having the value of 1 in said constant A islarger than the number L00 of the bits having the value of 0 in saidconstant A, said operation U is selected or if said m is larger than 3and if said L11 is smaller than said L00, said operation S is selected,while, if said m is smaller than 2, said operation T is selected.
 20. Amethod of automatically designing a logic circuit according to claim 17,whereinwhen said operation S is selected, said operation S isrecursively executed with respect to each of said multipliers M1 and M2,and when said operation T is selected, said operation T is recursivelyexecuted with respect to said multiplier M7.
 21. An apparatus forautomatically designing a logic circuit which generates a multiplier,said multiplier for providing a signal P composed of the product of asignal X, representing an n-bit number, and a signal A, representing anm-bit constant, comprising:an input means for inputting information onsignals X, A, and P; a multiplier generating means for generatinginformation on a multiplier M1, said multiplier M1 for providing asignal P1 composed of the product of a signal A1, representing thelow-order K bits of signal A, and signal X, and, if K is 0<K<m, forgenerating information on a multiplier M2 for providing a signal P2composed of the product of a signal A2, representing the high-order(m-K) bits of signal A, and signal X; a calculating circuit generatingmeans for generating information on a calculating circuit which receivesa signal Q1, composed of the high-order n bits of signal P1, and signalP2 as its inputs, and outputs the sum of Q1 and P2 as the high-order(n+m-K) bits of signal P and the low-order K bits of signal P1 as thelow-order K bits of signal P; an output means for outputting informationon said multipliers M1 and M2 generated by said multiplier generatingmeans, and information on said calculating circuit generated by saidcalculating circuit generating means; and a determining means fordetermining the value of said integer K, based on the number L1 of thebits having the value of 1 in said signal A1 and on the number L2 of thebits having the value of 1 in said signal A2.
 22. An apparatus forautomatically designing a logic circuit according to claim 21, whereinsaid determining means determines the value of the integer K so that theabsolute value of the difference between said L1 and L2 is minimized.23. An apparatus for automatically designing a logic circuit whichgenerates a multiplier for providing a signal P representing the productof a signal X representing an n-bit number and a signal A representingan m-bit constant, comprising:an input means for inputting informationon said signals X, A, and P; a determining means for determining thevalue of the K-th bit from the least significant bit in said signal A ifan integer K is 0<K<m; a multiplier generating means for generatinginformation on a multiplier M5 for providing a signal P5 representingthe product of a signal A5 composed of the low-order (K-1) bits of saidsignal A and said signal X and on a multiplier M6 for providing a signalP6 representing the product of a signal A6 composed of the high-order(m-K) bits of said signal A and said signal X; a first calculatingcircuit generating means for generating information on a firstcalculating circuit which receives said signals X, P5, and P6 as itsinputs and outputs, as said signal P, the sum of the product of saidsignal X and 2^(K-1), the product of said signal P6 and 2^(K), and saidsignal P5, if the value of said K-th bit is determined to be 1 by saiddetermining means; a second calculating circuit generating means forgenerating information on a second calculating circuit which receivessaid signals P5 and P6 as its inputs and outputs, as said signal P, thesum of said signal P5 and the product of said signal P6 and 2^(K), ifthe value of said K-th bit is 0; and an output means for outputtinginformation on said multipliers M5 and M6 which were generated by saidmultiplier generating means and on said first and second calculatingcircuits which were generated by said first and second calculatingcircuit generating means, respectively.
 24. An apparatus forautomatically designing a logic circuit which generates a multiplier forproviding a signal P representing the product of a signal X representingan n-bit number and a signal A representing an m-bit constant,comprisingan input means for inputting information on said signals X, A,and P; a signal generating means for generating information on a signalA7 which is obtained by turning the value of the K-th bit (0≦K≦m-1) fromthe least significant bit in said signal A from 1 to 0; a multipliergenerating means for generating information on a multiplier M7 forproviding a signal P7 representing the product of said signal A7 andsignal X; calculating circuit generating means for generatinginformation on a calculating circuit which receives said signals P7 andX as its inputs and outputs, as P, a signal representing the sum of saidsignal P7 and the product of said signal X and 2^(K) ; and an outputmeans for outputting information on said multiplier M7 which wasgenerated by said multiplier generating means and on said calculatingcircuit which was generated by said calculating circuit generatingmeans.
 25. An apparatus for automatically designing a logic circuitaccording to claim 24, wherein said K is 0 or (m-1).
 26. An apparatusfor automatically designing a logic circuit which generates anmultiplier for providing a signal P representing the product of a signalX representing an n-bit number and a signal A representing an m-bitconstant, comprising:an input means for inputting information on saidsignals X, A, and P; a determining means for determining whether or notthe number of the bits having the value of 1 in said signal A is largerthan a specified integer K (0<K<m); a logic NOT generating means forproviding the logic NOT signal A0 of said signal A, depending on theresult of determination by said determining means; a multipliergenerating means for generating information on a multiplier M0 whichreceives said A0 and X as its inputs and provides a signal P0representing the product of said A0 and X; a calculating circuitgenerating means for generating information on a calculating circuitwhich receives said X and an output signal P0 from said multiplier MO asits inputs and outputs, as said signal P, a signal representing thedifference between the product of said X and (2^(m) -1), and said P0;and an output means for outputting information on said multiplier M0which was generated by said multiplier generating means and on saidcalculating circuit which was generated by said calculating circuitgenerating means.
 27. An apparatus for automatically designing a logiccircuit according to claim 26, wherein said calculating circuitgenerating means further comprises:a circuit generating means forgenerating information on a calculating circuit which receives said X asits input and outputs a signal Q4 representing the difference betweenthe product of said X and 2^(m), and said X; and a subtract circuitgenerating means for generating information on a calculating circuitwhich receives an output signal P0 from said multiplier MO and saidsignal Q4 as its inputs and outputs, as said signal P, a signalrepresenting the difference between said Q4 and P0.
 28. An apparatus forautomatically designing a logic circuit according to claim 26, whereinsaid calculating circuit generating means further comprises:a logic NOTcircuit generating means for generating information on a calculatingcircuit which receives an output signal P0 from said multiplier M0 asits input and outputs the logic NOT signal Q0 of said signal P0; acircuit generating means for generating information on a calculatingcircuit which receives said X as its input and outputs a signal Q5representing the sum of the value 1 and the product of said X and (2^(m)-1); and an add circuit generating means for generating information on acalculating circuit which receives said signals Q0 and Q5 as its inputsand outputs, as said signal P, a signal representing the sum of said Q0and Q5.
 29. An apparatus for automatically designing a logic circuitaccording to any one of claims 26 to 28, further comprisinga determiningmeans for determining the value of said integer K to be the minimuminteger equal to or more than (m+2)/2.
 30. An apparatus forautomatically designing a logic circuit which generates a multiplier forproviding a signal P representing the product of a signal X representingan n-bit number and a signal A representing an m-bit constant,comprising:an input means for inputting information on signals X, A, andP; a first determining means for determining whether or not the numberof the bits having the value of 1 in said signal A is larger than aspecified integer K (0<K<m); a second-determining means for determiningwhether or not the value of the most significant bit in said signal A is1; a logic NOT means for providing the logic NOT signal A0 of saidsignal A, depending on the result of determination by said firstdetermining means; a first multiplier generating means for generatinginformation on a multiplier M0 which receives said A0 and X as itsinputs and provides a signal P0 representing the product of said A0 andX: a first calculating circuit generating means for generatinginformation on a first calculating circuit which receives said X and anoutput signal P0 from said multiplier M0 as its inputs and outputs, assaid signal P, a signal representing the difference between the produceof said X and (2^(m) -1), and said P0; a second multiplier generatingmeans for generating information on a multiplier M1 for providing asignal P1 representing the product of a signal A1 composed of thelow-order K bits of said signal A and said signal X and on a multiplierM2 for providing a signal P2 representing the product of a signal A2composed of the high-order (m-K) bits of said signal A and said signalX, if an integer K is 0<K<m; a second calculating circuit generatingmeans for generating information on a second calculating circuit whichreceives a signal Q1 composed of the high-order n bits of said signal P1and said signal P2 as its inputs and outputs a signal representing thesum of Q1 and P2 as the high-order (n+m-K) bits of said signal P andoutputs a signal composed of the low-order K bits of said signal P1 asthe low-order K bits of said signal P; a third multiplier generatingmeans for generating information on a multiplier M3 for providing asignal P3 representing the product of a signal A3 composed of thelow-order (m-1) bits of said signal A and said signal X; a thirdcalculating circuit generating means for generating information on athird calculating circuit which outputs said signal P3 as the low-order(m-1) bits of said signal P and which receives the signal Q1 composed ofthe high-order n bits of said signal P3 and said signal X as its inputsand outputs a signal representing the sum of said signal Q1 and saidsignal X as the high-order (n+1) bits of said signal P, if the value ofsaid most significant bit is determined to be 1 by said seconddetermining means; a fourth calculating circuit generating means forgenerating information on a fourth calculating circuit which outputssaid signal P3 as the low-order (n+m-1) bits of said signal P andoutputs a signal having the value of 0 as the high-order 1 bit of saidsignal P, if the value of said most significant bit is determined to be0 by said second determining means; and an output means for outputtinginformation on said multipliers M0, M1 and M2, and M3 which weregenerated by said first, second, and third multiplier generating means,respectively, and on said first, second, third, and fourth calculatingcircuits which were generated by said first, second, third, and fourthcalculating circuit generating means, respectively.
 31. A multiplierwhich receives a signal X representing an n-bit number and a signal Arepresenting an m-bit constant as its inputs and outputs their product Phaving the bit width of (n+m), comprising:a multiplying means whichreceives the logic NOT signal A0 of said constant A and said signal X asits inputs and outputs a signal PO representing their product; and acorrecting means which receives said signal X and signal P0 as itsinputs, calculates X*(2^(m) -1)-P0, and outputs the result ofcalculation as said P.
 32. A multiplier according to claim 31, whereinsaid correcting means further comprises:a calculating means whichreceives said signal X as its input and outputs a signal P01representing X*(2^(m) -1); and a subtract means which receives saidsignal P0 and signal P01 as its inputs and outputs a signal representingthe value of (P01-P0).
 33. A multiplier according to claim 31, whereinsaid correcting means further comprises:a logic NOT means which receivessaid signal P0 as its input and outputs the logic NOT signal Q0 of saidsignal P0; a calculating means which receives said signal X as its inputand outputs a signal Q6 representing X*(2^(m) -1)+1; and an adding meanswhich receives said signal Q0 and signal Q6 as its inputs and outputs,as said P, a signal representing the sum of said signal Q0 and signalQ6.
 34. A multiplier according to claim 31, wherein said correctingmeans further comprises:a first logic NOT means which receives saidsignal X as its input and outputs the logic NOT signal of said signal X;a second logic NOT means which receives said signal P0 as its input andoutputs the logic NOT signal of said signal P0; a first adding meanswhich receives as its inputs a signal having the bit width of (n+m) inwhich the values of its low-order m bits are set to 0 and said signal Xis set in its high-order n bits, a signal having the bit width of (n+m)in which an output signal from said first logic NOT means is set in itslow-order n bits and the values of its high-order m bits are set to 1,and the value 1 serving as a carry; and a second adding means whichreceives, as its inputs, an output signal from said second logic NOTmeans, an output signal from said first adding means, and the value 1serving as a carry and outputs said P.